#!/bin/bash

check_dir=$1
lib_dir=$2
if [ -z $lib_dir ]; then
    lib_dir=$check_dir
fi

rm -f so_deps.csv
rm -f symble_deps.csv

echo "src_so,dep_so" >> so_deps.csv
echo "src_so,dep_symbol" >> symble_deps.csv

export compiler=/usr/bin/gcc

for so in $(find $check_dir -name "*.so*" -type f); do
    sh make_app.sh $so $lib_dir
done

echo "Checking finish. Please check the result in so_deps.csv and symble_deps.csv."